package com.zsc.eb.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zsc.eb.mapper.EbProductMapper;
import com.zsc.eb.mapper.EbUserMapper;
import com.zsc.eb.model.EbProduct;
import com.zsc.eb.model.EbUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service//业务证
public class EbUserServiceImpl implements EbUserService {

    @Autowired
    private EbUserMapper ebUserMapper;



    @Override
    public EbUser login(EbUser ebUser) {
        EbUser lgnUser = ebUserMapper.selectOne(Wrappers.<EbUser>lambdaQuery()
                .eq(EbUser::getEuUserId, ebUser.getEuUserId())
                .eq(EbUser::getEuPassword, ebUser.getEuPassword()));
        return lgnUser;
    }

    @Override
    public EbUser register(EbUser ebUser) {
        int result =ebUserMapper.insert(ebUser) ;
        if (result<=0){
            return null;
        }
        return ebUser;
    }


}
